<?php
/**
 *
 *
 *
 */
namespace Yz\modules\Generic;

class Action_UpdateById
    extends Action_Update
    implements \Yz_Action_Interface
{


    /**
     *  @var int ?
     */
    protected $id;

    /**
     *  @param int id > 0
     *  @return this
     */
    public function setId( $id )
    {
        debug();
        $this->id = \Yz_Int::testPositive($id);
        return $this;
    }


    /**
     *  Modified UPDATE statement creator
     *
     */
    protected function buildUpdate()
    {
        $sql = parent::buildUpdate();
        $sql
            ->where("id=:UpdateById_id")
            ->bind("UpdateById_id", $this->id);
        return $sql;
    }


}
